
#include <stdlib.h>
#include <string.h>

#define g_alloc(ptr, type, size) {ptr = (type)malloc(size);}
#define g_allocv(ptr, type, size) {ptr = (type*)malloc(sizeof(type)*(size));}
#define  g_free(ptr) {if (ptr) {free(ptr); ptr = NULL;}}
#define g_strdup(ptr1, ptr2) {g_allocv(ptr1, char, strlen(ptr2)+1);ptr1=strcpy(ptr1,ptr2);}

#define g_strcpy strcpy
#define g_strncpy strncpy
#define g_strcmp strcmp